//
//  CLHTableViewCollectionViewCVCell.m
//  ListViewModel_Example
//
//  Created by 曹连华 on 2019/7/31.
//  Copyright © 2019 clh2046@163.com. All rights reserved.
//

#import "CLHTableViewCollectionViewCVCell.h"
#import "CLHTableViewCollectionViewCVCellModel.h"
#import <Masonry/Masonry.h>
@interface CLHTableViewCollectionViewCVCell ()
@property (nonatomic, strong) UILabel *label;
@end

@implementation CLHTableViewCollectionViewCVCell
-(UILabel *)label {
    if(!_label) {
        _label = [[UILabel alloc]init];
        _label.textColor = [UIColor blackColor];
        _label.font = [UIFont systemFontOfSize:13];
        _label.backgroundColor = [UIColor whiteColor];
    }
    return _label;
}
- (void)initUI {
    self.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.label];
    
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.top.mas_equalTo(2);
        make.trailing.bottom.mas_equalTo(-2);
    }];
}
- (void)updateCVCCellWithRowModel:(CLHTableViewCollectionViewCVCellModel *)rowModel atIndexPath:(NSIndexPath *)indexPath {
    self.label.text = rowModel.mainTitle;
}
@end
